Here's a sample of how you'd use the ComboPicker widget. This assumes you've unzipped the fins widget directory (http://buoy.riverweb.com:8080/viewrep/cvs/FinScribe/static/javascripts/fins/fins.zip )at the same location that dojo.js is located (that is, dojo.js, src/ and fins/ are all in the same directory).
<script type='text/javascript'> djConfig = { isDebug : true }; </script> <script src="/static/javascripts/dojo.js"></script> <script type='text/javascript'> dojo.hostenv.setModulePrefix("fins.widgets", "../fins/widgets" ); dojo.require("fins.widget.*"); function getMembers() { var res = null; var bindArgs = { url: "/admin/getusers_json/" + "<%$group.id%>" , mimetype: "text/plain", sync: true, error: function(type, errObj){ }, load: function(type, data, evt){ // handle successful response here res = dojo.json.evalJSON(data.toString()); res = res.data; } }; // dispatch the request var requestObj = dojo.io.bind(bindArgs); return res; } function getAvailable() { var res = null; var bindArgs = { url: "/admin/getusers_json/", mimetype: "text/plain", sync: true, error: function(type, errObj){ }, load: function(type, data, evt){ // handle successful response here res = dojo.json.evalJSON(data.toString()); res = res.data; } }; // dispatch the request var requestObj = dojo.io.bind(bindArgs); return res; }; </script> <form action="someaction"> <div dojoType="ComboPicker" loadAvailableFunction="getAvailable" loadMembersFunction="getMembers" addsId="added" removesID="removed"></div> <input type="submit" value="Save"/> </form>
Name | Type | Size | Updated | Updated By |
combopicker.png | image/png | 4 kb | Wednesday, 1 March 2006 | Bill Welliver |